|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectPER.rover.control.RoverState
Allows one to determine the current status of the rover. The state is updated when commands are sent to the rover or by calling refresh in RoverController. The constants in this class are used to represent the rovers current status as well as used as Action return values.
RoverController.refresh()
,
Action.getReturnValue()
Field Summary | |
static int |
BAD_INPUT
Function call to the Stayton with bad input arguments. |
static int |
BATTERY_LOW
Battery voltage low. |
static int |
CAMERA_TIMEOUT
The cameara failed to respond. |
static int |
CEREB_DRIVETO
|
static int |
CEREB_IDLE
|
static int |
CEREB_SCAN
|
static int |
CEREB_STARTING
|
static int |
CEREB_TIMEOUT
The cerebeluum failed to respond. |
static int |
CEREB_TURNTO
|
int |
cerebThreadState
The state of the cerebellum thread |
static int |
COMM_DEAD
Wireless communication not working. |
static int |
FULL_PACKET_LENGTH
Length of a packet from the rover. |
static int |
HIT_WALL
Came too close to a wall. |
static int |
HL_CONTINUE
This code indicates that the rover is currently doing a DriveTo or TurnTo |
static int |
INVALID_PACKET_LENGTH
Response from Stayton is the wrong length. |
static int |
KILLED
Manually terminated. |
static int |
LEGS_LOCK
|
int |
locks
A bitmask telling you what parts of the rover are in use |
static int |
NOT_CONNECTED
Not connected to the robot. |
static int |
OBSTACLE_DETECTED
IR Rangefinder detected an obstacle. |
static int |
PAN_LOCK
|
static int |
RESOURCE_CONFLICT
What you're trying to do can't be done because the resource is already in use. |
static int |
STAYTON_INVALID_LENGTH
Command to the Stayton is the wrong length. |
static int |
STAYTON_IO_ERROR
Error on Stayton. |
static int |
STAYTON_UNKNOWN_TYPE
The Stayton does not recognize the command sent to it. |
static int |
SUCCESS
Command successful. |
static int |
TILT_LOCK
|
static int |
UNKNOWN_PACKET_TYPE
Sent unknown packet type to Stayton. |
static int |
WEBCAM_CYCLE_PIC
|
static int |
WEBCAM_CYCLY_NOPIC
|
static int |
WEBCAM_GRAB
|
static int |
WEBCAM_IDLE
|
static int |
WEBCAM_MEAN
|
static int |
WEBCAM_MOTION
|
static int |
WEBCAM_PIC
|
static int |
WEBCAM_PROPERTIES
|
static int |
WEBCAM_STOP
|
static int |
WEBCAM_TRACK
|
int |
webCamThreadState
The state of the web cam thread |
Constructor Summary | |
RoverState()
Creates new RoverState |
Method Summary | |
int |
getDist()
Returns the absolute value of how far the rover has traveled. |
int |
getPan()
Gets the pan angle. |
double[] |
getPosition()
Returns the current coordinates of the robot. |
int |
getRange()
Returns the raw IR rangefinder reading from the cerebellum. |
int |
getRangeCM()
This function attempts to translate the range from the range sensing output of the sensor to centimeters. |
int |
getRawVoltage()
Gets the raw voltage reading from the cerebellum. |
double |
getRealVoltage()
Gets a translated voltage reading on the robot. |
int |
getStatus()
Gets the last status code that the rover sent back. |
java.lang.String |
getStatusMessage()
Gives a description of the status of the last command sent. |
int |
getTilt()
Gets the tilt angle. |
boolean |
isTerminationCondition()
Function to help with high level commands. |
boolean |
parsePacket(byte[] packet)
Parses a packet from the rover. |
void |
setCrabAngle(int cA)
Set the current angle representing the direction of motion of the robot regardless of it's heading. |
void |
setPan(int pan)
Sets the current status; This should only be done in ReceiveThread. |
void |
setPosition(double x,
double y,
double theta)
Sets the current coordinate position. |
void |
setSign(int sign)
Set the current sign representing the direction of motion of the robot. |
void |
setStatus(int status)
Sets the current status; This should only be done in RoverController. |
void |
setTilt(int tilt)
Sets the current status; This should only be done in ReceiveThread. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public int locks
public int cerebThreadState
public int webCamThreadState
public static final int LEGS_LOCK
public static final int PAN_LOCK
public static final int TILT_LOCK
public static final int CEREB_IDLE
public static final int CEREB_STARTING
public static final int CEREB_SCAN
public static final int CEREB_TURNTO
public static final int CEREB_DRIVETO
public static final int WEBCAM_IDLE
public static final int WEBCAM_STOP
public static final int WEBCAM_CYCLE_PIC
public static final int WEBCAM_CYCLY_NOPIC
public static final int WEBCAM_PIC
public static final int WEBCAM_GRAB
public static final int WEBCAM_PROPERTIES
public static final int WEBCAM_TRACK
public static final int WEBCAM_MEAN
public static final int WEBCAM_MOTION
public static final int FULL_PACKET_LENGTH
public static final int SUCCESS
public static final int HL_CONTINUE
public static final int INVALID_PACKET_LENGTH
public static final int UNKNOWN_PACKET_TYPE
public static final int COMM_DEAD
public static final int NOT_CONNECTED
public static final int STAYTON_INVALID_LENGTH
public static final int STAYTON_UNKNOWN_TYPE
public static final int BAD_INPUT
public static final int CEREB_TIMEOUT
public static final int CAMERA_TIMEOUT
public static final int STAYTON_IO_ERROR
public static final int BATTERY_LOW
public static final int KILLED
public static final int OBSTACLE_DETECTED
public static final int HIT_WALL
public static final int RESOURCE_CONFLICT
Constructor Detail |
public RoverState()
Method Detail |
public boolean parsePacket(byte[] packet)
packet
- The packet, which should be FULL_PACKET_LENGTH long.
public int getStatus()
getStatusMessage()
public java.lang.String getStatusMessage()
public void setStatus(int status)
public void setPan(int pan)
public void setTilt(int tilt)
public void setSign(int sign)
public void setCrabAngle(int cA)
public void setPosition(double x, double y, double theta)
x
- The new X coordinate in centimetersy
- The new Y coordinate in centimeterstheta
- The new orientation, in integer degreespublic int getRange()
public int getRangeCM()
public int getPan()
public int getTilt()
public int getRawVoltage()
public double getRealVoltage()
public int getDist()
public double[] getPosition()
public boolean isTerminationCondition()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |